=over

=item shift ARRAY
X<shift>

=item shift

Shifts the first value of the array off and returns it, shortening the
array by 1 and moving everything down.  If there are no elements in the
array, returns the undefined value.  If ARRAY is omitted, shifts the
L<C<@_>|perlvar/@_> array within the lexical scope of subroutines and
formats, and the L<C<@ARGV>|perlvar/@ARGV> array outside a subroutine
and also within the lexical scopes
established by the C<eval STRING>, C<BEGIN {}>, C<INIT {}>, C<CHECK {}>,
C<UNITCHECK {}>, and C<END {}> constructs.

Starting with Perl 5.14, an experimental feature allowed
L<C<shift>|/shift ARRAY> to take a
scalar expression. This experiment has been deemed unsuccessful, and was
removed as of Perl 5.24.

See also L<C<unshift>|/unshift ARRAY,LIST>, L<C<push>|/push ARRAY,LIST>,
and L<C<pop>|/pop ARRAY>.  L<C<shift>|/shift ARRAY> and
L<C<unshift>|/unshift ARRAY,LIST> do the same thing to the left end of
an array that L<C<pop>|/pop ARRAY> and L<C<push>|/push ARRAY,LIST> do to
the right end.

=back